package com.web44.springboot.config;

import com.web44.springboot.servlet.HelloServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * @Title: ServletConfig
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/2/29 15:15
 */
@Configuration
public class ServletConfig {

    @Bean
    public ServletRegistrationBean<HelloServlet> helloServletServlet() {
        ServletRegistrationBean<HelloServlet> registrationBean = new ServletRegistrationBean();
        registrationBean.setServlet(new HelloServlet());
        registrationBean.setUrlMappings(Arrays.asList("/helloServlet"));
        return registrationBean;
    }
}
